version: "3"
services:
  gluetun:
    container_name: gluetun
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      - VPN_SERVICE_PROVIDER=cyberghost
      - OPENVPN_USER=pvDXWWNiJm  # Replace with your actual username
      - OPENVPN_PASSWORD=WvCrDvzh8r  # Replace with your actual password
      - SERVER_COUNTRIES=Netherlands
      - PUID=1000 
      - PGID=999 
    volumes:
      - /mnt/storagepool/media/software/gluetun:/gluetun
    ports:
      - 8112:8112
    restart: always
    healthcheck:
      test: ["CMD", "curl", "-s", "--fail", "https://www.google.com"] 
      interval: 30s
      timeout: 10s
      retries: 5

  deluge:
    container_name: deluge
    image: linuxserver/deluge:latest
    restart: unless-stopped
    network_mode: service:gluetun
    environment:
      - PUID=1000 
      - PGID=999 
      - TZ=America/New_York
    volumes:
      - /mnt/storagepool/media/downloads:/downloads
      - /mnt/storagepool/media/software/deluge:/config
    depends_on:
      gluetun:
        condition: service_healthy